﻿<%@ Control Language="C#" AutoEventWireup="false" CodeFile="searching.ascx.cs" Inherits="SIPO.Web.usercontrols.searching" %>
   
    <div>
        <table>
            <tr>
                <td>
                    Search By :
                    <asp:dropdownlist id="ddlField" runat="server"></asp:dropdownlist>
                    <asp:dropdownlist id="ddlOperand" runat="server"></asp:dropdownlist>        
                    <asp:textbox id="txtValue" runat="server"></asp:textbox>                
                </td>           
                <td class="divbutton">
                    <a href="#" id="btnSearch" class="dialog_link ui-state-default ui-corner-all"><span class="ui-icon ui-icon-search"></span>Search</a>                                                    
                </td> 
            </tr>            
        </table>                        
    </div>
    
    <script type="text/javascript">

        $('#<%= ddlField.ClientID %>').change(function() {

            var field = $('#<%= ddlField.ClientID %> option:selected').val();

            if (field.toLowerCase().match(/date/) != null) {
                $('#<%= txtValue.ClientID %>').datepicker({ showWeek: true, showButtonPanel: true,
                    changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', yearRange: '2010:2030'
                });
            }
            else {
                $('#<%= txtValue.ClientID %>').datepicker('destroy');
            }

        });
    
    </script>
    
